using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using PointOfSale.Transaction;

namespace PointOfSale.Transaction
{
	/// <summary>
	/// Summary description for frmPrintTransactionBill.
	/// </summary>
	public class frmPrintTransactionBill : System.Windows.Forms.Form
	{
		private CrystalDecisions.Windows.Forms.CrystalReportViewer crvPrintTransactionBill;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private string invoiceNo;
		private string invoiceDate;
		private string lastName;
		private string firstName;
		private string total;
		private string tax;
		private string invoiceAmount;
		private string paidAmount;
		private string postAmount;
		private string userName;
		private string remark;
		private string itemName;
		private string quantity;

		public frmPrintTransactionBill(string invNo, string id, string ln, string fn, string tt, string ta, string ia, string paid, string post, string un, string rm, string itn, string qty)
		{
			invoiceNo = invNo;
			invoiceDate = id;
			lastName = ln;
			firstName = fn;
			total = tt;
			tax = ta;
			invoiceAmount = ia;
			paidAmount = paid;
			postAmount = post;
			userName = un;
			remark = rm;
			itemName = itn;
			quantity = qty;
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.crvPrintTransactionBill = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
			this.SuspendLayout();
			// 
			// crvPrintTransactionBill
			// 
			this.crvPrintTransactionBill.ActiveViewIndex = -1;
			this.crvPrintTransactionBill.DisplayGroupTree = false;
			this.crvPrintTransactionBill.Dock = System.Windows.Forms.DockStyle.Fill;
			this.crvPrintTransactionBill.Location = new System.Drawing.Point(0, 0);
			this.crvPrintTransactionBill.Name = "crvPrintTransactionBill";
			this.crvPrintTransactionBill.ReportSource = null;
			this.crvPrintTransactionBill.Size = new System.Drawing.Size(680, 544);
			this.crvPrintTransactionBill.TabIndex = 0;
			// 
			// frmPrintTransactionBill
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(680, 544);
			this.Controls.Add(this.crvPrintTransactionBill);
			this.Name = "frmPrintTransactionBill";
			this.Text = "Print bill";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.frmPrintTransactionBill_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmPrintTransactionBill_Load(object sender, System.EventArgs e)
		{
			rptPrintTransactionBill _rptPrintTransactionBill = new rptPrintTransactionBill();
			_rptPrintTransactionBill.SetParameterValue("invoiceNo", invoiceNo);
			_rptPrintTransactionBill.SetParameterValue("invoiceDate", invoiceDate);
			_rptPrintTransactionBill.SetParameterValue("lastName", lastName);
			_rptPrintTransactionBill.SetParameterValue("firstName", firstName);
			_rptPrintTransactionBill.SetParameterValue("total", total);
			_rptPrintTransactionBill.SetParameterValue("tax", tax);
			_rptPrintTransactionBill.SetParameterValue("invoiceAmount", invoiceAmount);
			_rptPrintTransactionBill.SetParameterValue("paidAmount", paidAmount);
			_rptPrintTransactionBill.SetParameterValue("postAmount", postAmount);
			_rptPrintTransactionBill.SetParameterValue("userName", userName);
			_rptPrintTransactionBill.SetParameterValue("remark", remark);
			_rptPrintTransactionBill.SetParameterValue("itemName", itemName);
			_rptPrintTransactionBill.SetParameterValue("quantity", quantity);
			this.crvPrintTransactionBill.ReportSource = _rptPrintTransactionBill;
		}
	}
}
